<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>我的佣金</title>
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport" />
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta content="telephone=no" name="format-detection" />
    <!-- 引入YDUI样式 -->
    <link rel="stylesheet" href="../build/css/ydui.css" />
	<link rel="stylesheet" href="../css/common.css" />
	<link rel="stylesheet" href="../css/fontcss/css/font-awesome.min.css" />
    <!-- 引入YDUI自适应解决方案类库 -->
    <script src="../build/js/ydui.flexible.js"></script>
	<style>
		.topbg{width: 100%; position: relative;}
		.topbg img{max-width: 100%;}
		.yjinfo{left: calc(50% - 25px);position: absolute;top: calc(50% - 65px); color:#fff;text-align: center;}
		.ktyj{ margin-top: .25rem;}
		.desc{
			padding: .15rem 0;
			border-bottom: .1rem solid #eee;
			text-align: center;
			color: #737373;
			font-size: .25rem;
		}
		.item-list{
			padding: .35rem;
		}
		.item-list li{
			padding: .025rem;
			color:#A1A1A1
		}
		
		.item-list li input{
			border: 0;
			color:#A1A1A1
		}
		.item-list li span{
			float: right;
			color: #C1060F;
			font-size: .25rem;
		}
		.item-list li.name input{
			font-size: .3rem; color:#000; margin-bottom: .1rem; font-family: initial;
		}
		
	</style>
</head>
<body>
	<section class="g-flexview">
		<!-- 顶部内容 -->
		<header class="m-navbar">
			<a href="#" onClick="javascript :window.history.back(); return false;" class="navbar-item">
				<i class="back-ico"></i>
			</a>
			<div class="navbar-center">
				<span class="navbar-title">我的佣金</span>
			</div>
		</header>
		
		<!-- 主体内容 -->
		<div class="g-scrollview">
			<div class="topbg">
				<img src="../static/images/cash.png" />
				<div class="yjinfo">
					<div>可提佣金</div>
					<div class="ktyj"><i class="fa fa-cny"></i>&nbsp;<a  id="cashtotal" style="font-size: .35rem;"></a></div>
				</div>
				<p class="desc">佣金明细</p>
			</div>
			<div id="infolist" class="infolist"></div>
		</div>
		<!-- 报备客户按钮 -->
		<a href="reportecustomers/homebaobei.html">
			<div id="preparation">报备</div>
		</a>
</section>
<!-- 引入jQuery 3.0+ -->
<script src="../js/jq331.min.js"></script>
<!-- 引入YDUI脚本 -->
<script src="../js/common.js"></script>
<script src="../build/js/ydui.js"></script>
<script src="../js/template.js"></script>
<!-- <script src="../js/Index.js"></script> -->
<script id="cashscript" type="text/html">
	{{each data as value index}}
	{{if data[index].id}}
		<div class="item-list">
			<ul>
				<li class="name"><input class="name" value="{{data[index].name}}" name="" readonly="readonly"></input></li>
				<li class="houseplace"><label>楼盘：</label><input value="{{data[index].house_title}}" name="" readonly="readonly"></input></li>
				<li class="tel"><label>手机：</label><input value="{{data[index].number}}" name="" readonly="readonly"></input></li>
				<li class="plan"><label>佣金方案：</label><input value="{{data[index].house_area}}㎡" name="" readonly="readonly"></input><span><a>{{data[index].commission}}</a>元</span></li>
			</ul>
		</div>
	{{/if}}
	{{/each}}
</script>
</body>
<script>
	$(document).ready(function(){
		var getmycashApi = commapi + "comm/commlist";
		console.log(dataToken)
		$.ajax({
			url: getmycashApi,
			type: 'POST',									
			data: {},
			beforeSend: function(request) {
					request.setRequestHeader("token", dataToken);
					},
			success: function (ret) {	
				console.log(ret)
				$('#cashtotal').html(ret.sum);
				if(ret.sum == 0){
					 $('#infolist').html("<p style='text-align:center; padding: 2rem 0; font-size:14px; color: #C1060F;'>哎呀，暂无佣金可拿&nbsp;&nbsp;~_~</p>");			
				}else{
					var html = template('cashscript', {data: ret});
					$('#infolist').html(html);
				}									
			}
		});
	});
</script>
</html>